import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class PageAssetsHeaderCom extends StatefulWidget
    implements PreferredSizeWidget {
  Widget? WidgetLeft;
  Widget? WidgetRight;
  double height = 52.w;

  PageAssetsHeaderCom(
      {super.key, this.WidgetLeft, this.WidgetRight, this.height = 52});

  @override
  State<PageAssetsHeaderCom> createState() => _PageHeaderAssetsComState();

  @override
  Size get preferredSize => Size(400.w, this.height); //其实这里的值对最后的高度没有什么影响
}

class _PageHeaderAssetsComState extends State<PageAssetsHeaderCom> {
  @override
  Widget build(BuildContext context) {
    final statusBarHeight = MediaQuery.of(context).padding.top;
    // TODO: implement build
    return Container(
      width: double.infinity,
      child: Column(
        children: [
          SizedBox(
            height: statusBarHeight,
          ),
          Expanded(
              flex: 1,
              child: Container(
                child: Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  crossAxisAlignment: CrossAxisAlignment.center,
                  children: [
                    widget.WidgetLeft!,
                    widget.WidgetRight!,
                  ],
                ),
              ))
          // Expanded(child: child),
        ],
      ),
    );
  }
}
